package com.maimao.model.goods;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author MaoLin Wang
 * @date 2020/11/27 11:34 下午
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("mm_goods_detail")
@JsonInclude(JsonInclude.Include.NON_NULL)

public class GoodsDetail implements Serializable {

    private static final long serialVersionUID = -1030940452497390592L;

    @TableId(type = IdType.INPUT)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long goodsId;

    /**
     * 商品内容 富文本
     */
    @NotBlank(message = "请填写商品介绍")
    @TableField("content")
    private String content;

    /**
     * 通用参数 json格式
     */
    @NotBlank(message = "请填写类目属性")
    @TableField("common_param")
    private String commonParam;

    /**
     * sku参数 json格式
     */
    @NotBlank(message = "请填写销售规格")
    @TableField("sku_param")
    private String skuParam;

    /**
     * 包装清单
     */
    @NotBlank(message = "请填写包装清单")
    @TableField("packing_list")
    private String packingList;

    /**
     * 售后保障
     */
    @NotBlank(message = "请填写售后保障")
    @TableField("after_sale_protection")
    private String afterSaleProtection;

    @Override
    public String toString() {
        return "GoodsDetail{" +
                "goodsId=" + goodsId +
                ", content='" + content + '\'' +
                ", commonParam='" + commonParam + '\'' +
                ", skuParam='" + skuParam + '\'' +
                ", packingList='" + packingList + '\'' +
                ", afterSaleProtection='" + afterSaleProtection + '\'' +
                '}';
    }
}
